<template>
	<view>
		<ToolbarItemContainer :iconFile="callVideo" title="发起视频" :needDialog="false" iconWidth="32px"
			iconHeight="32px" @onIconClick="onIconClick">

		</ToolbarItemContainer>
	
	</view>
</template>
<script lang="ts" setup>
	import {
		TUIChatService,
		TUIStore,
		StoreName,
		IConversationModel,
		SendMessageParams,
	} from "@tencentcloud/chat-uikit-engine";
	import {
		TUICallKit
	} from "../../../../utils/checkLogin.js";
	import { TUIGlobal } from "@tencentcloud/universal-api";
	import { ref } from "../../../../adapter-vue";
	import { isPC, isWeChat, isUniFrameWork } from "../../../../utils/env";
	import ToolbarItemContainer from "../toolbar-item-container/index.vue";
	import callVideo from "../../../../assets/icon/call-video.svg";
	import videoUniIcon from "../../../../assets/icon/video-uni2.png";
	import cameraUniIcon from "../../../../assets/icon/camera-uni.png";
	import { Toast, TOAST_TYPE } from "../../../common/Toast";
	import { isEnabledMessageReadReceiptGlobal } from "../../utils/utils";
	
	const currentConversation = ref<IConversationModel>();
	const emits = defineEmits(["close","show"]);
	TUIStore.watch(StoreName.CONV, {
		currentConversation: (conversation : IConversationModel) => {
			currentConversation.value = conversation;
		},
	});

	const handleIcon = () : string => {
		if (isUniFrameWork) {
			return videoUniIcon;
		} else {
			return videoIcon;
		}
	};
	const onIconClick = () => {
		if(currentConversation.value.type === "GROUP"){//选择群成员通话
			//群组不需要弹窗选择语音还是什么
			//选择群成员通话
			TUIGlobal?.navigateTo({
				url: '/pages/TUIKit/components/TUIGroup/manage-group/manage-userList?title=' + '发起通话' + '&GroupID=' + currentConversation.value.groupProfile.groupID + '&type=' + 'callKit'+'&callType='+1
			})
		}else{
			emits('show')
		}
		
	}
	

</script>
<style lang="scss" scoped>
	@import url(../../../../assets/styles/common.scss);
</style>